package com.xxcxcxcx.xc_crop.common.inits;
import com.google.common.base.Supplier;
import com.xxcxcxcx.xc_crop.Main;
import net.minecraft.world.food.Foods;
import net.minecraft.world.item.CreativeModeTab;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemNameBlockItem;
import net.minecraft.world.level.block.Blocks;
import net.minecraftforge.registries.DeferredRegister;
import net.minecraftforge.registries.ForgeRegistries;
import net.minecraftforge.registries.RegistryObject;

public class ItemInit {
    //注册机
    public static final DeferredRegister<Item> ITEMS = DeferredRegister.create(ForgeRegistries.ITEMS, "minecraft");
//    public static final RegistryObject<Item> EXAMPLE_ITEM = register("example_item",
//            () -> new Item(new Item.Properties().tab(Main.TUTORIAL_TAB)));
    public static final RegistryObject<Item> OAK_SAPLING = register("oak_sapling",() -> new ItemNameBlockItem(BlockInit.OAK_SAPLING.get(), (new Item.Properties()).tab(Main.TUTORIAL_TAB)));
    public static final RegistryObject<Item> SPRUCE_SAPLING = register("spruce_sapling",() -> new ItemNameBlockItem(BlockInit.SPRUCE_SAPLING.get(), (new Item.Properties()).tab(Main.TUTORIAL_TAB)));
    public static final RegistryObject<Item> BIRCH_SAPLING = register("birch_sapling",() -> new ItemNameBlockItem(BlockInit.BIRCH_SAPLING.get(), (new Item.Properties()).tab(Main.TUTORIAL_TAB)));
    public static final RegistryObject<Item> JUNGLE_SAPLING = register("jungle_sapling",() -> new ItemNameBlockItem(BlockInit.JUNGLE_SAPLING.get(), (new Item.Properties()).tab(Main.TUTORIAL_TAB)));
    public static final RegistryObject<Item> ACACIA_SAPLING = register("acacia_sapling",() -> new ItemNameBlockItem(BlockInit.ACACIA_SAPLING.get(), (new Item.Properties()).tab(Main.TUTORIAL_TAB)));
    public static final RegistryObject<Item> DARK_OAK_SAPLING = register("dark_oak_sapling",() -> new ItemNameBlockItem(BlockInit.DARK_OAK_SAPLING.get(), (new Item.Properties()).tab(Main.TUTORIAL_TAB)));
    public static final RegistryObject<Item> MELON = register("melon",() -> new ItemNameBlockItem(BlockInit.MELON.get(), (new Item.Properties()).tab(Main.TUTORIAL_TAB)));
    public static final RegistryObject<Item> MELON_SEEDS = register("melon_seeds",() -> new ItemNameBlockItem(BlockInit.MELON_STEM.get(), (new Item.Properties()).tab(Main.TUTORIAL_TAB)));
    public static final RegistryObject<Item> PUMPKIN = register("pumpkin",() -> new ItemNameBlockItem(BlockInit.PUMPKIN.get(), (new Item.Properties()).tab(Main.TUTORIAL_TAB)));
    public static final RegistryObject<Item> PUMPKIN_SEEDS = register("pumpkin_seeds",() -> new ItemNameBlockItem(BlockInit.PUMPKIN_STEM.get(), (new Item.Properties()).tab(Main.TUTORIAL_TAB)));
    private static <T extends Item> RegistryObject<T> register(final String name, final Supplier<T> item) {
        return ITEMS.register(name, item);
    }

}
